﻿
namespace ATA.Windows.Forms
{
	/// <summary>
	/// abstract ChietKhauDacBietDs typed datagridview
	/// </summary>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class ChietKhauDacBietDsDataGridViewBase : System.Windows.Forms.UserControl
	{	
		/// <summary> 
		/// Thrown when the current Entity changed.
		/// </summary>
		public event System.EventHandler<ChietKhauDacBietDsDataGridViewEventArgs> CurrentEntityChanged;
		
		#region Fields
				
		/// <summary> 
		/// the current entity.
		/// </summary>
		private Entities.ChietKhauDacBietDs _currentChietKhauDacBietDs = null;
		//private Dictionary<string, string> _columnsHeaders = new Dictionary<string, string>();
		
		/// <summary> 
		/// the datagridview instance
		/// </summary>
		protected System.Windows.Forms.DataGridView uxChietKhauDacBietDsDataGridView;
		
		/// <summary> 
		/// the errorprovider
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxChietKhauDacBietDsErrorProvider;
		
		/// <summary> 
		/// the bindingsource
		/// </summary>
		protected System.Windows.Forms.BindingSource uxChietKhauDacBietDsBindingSource;
		
		
		/// <summary> 
		/// the DGV column associated with the ChietKhauDacBietDsid property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxChietKhauDacBietDsidDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the NhomSanPhamId property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxNhomSanPhamIdDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the MucThuong property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxMucThuongDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the GhiChu property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxGhiChuDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the ChietKhauId property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxChietKhauIdDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the LastUpdate property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxLastUpdateDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the UpdateBy property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxUpdateByDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the LoaiThoiGianId property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxLoaiThoiGianIdDataGridViewColumn;
		
		#endregion
					
		#region Combo list
		
				
		private Entities.TList<Entities.ChietKhau> _ChietKhauIdList;
		
		/// <summary> 
		/// The list of selectable ChietKhau
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.ChietKhau> ChietKhauIdList
		{
			get {return this._ChietKhauIdList;}
			set 
			{
				this._ChietKhauIdList = value;
				this.uxChietKhauIdDataGridViewColumn.DataSource = null;
				this.uxChietKhauIdDataGridViewColumn.DataSource = this._ChietKhauIdList;
			}
		}
		
		private bool _allowNewItemInChietKhauIdList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of ChietKhau
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInChietKhauIdList
		{
			get { return _allowNewItemInChietKhauIdList;}
			set
			{
				this._allowNewItemInChietKhauIdList = value;
				this.uxChietKhauIdDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
				
		private Entities.TList<Entities.LoaiThoiGian> _LoaiThoiGianIdList;
		
		/// <summary> 
		/// The list of selectable LoaiThoiGian
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.LoaiThoiGian> LoaiThoiGianIdList
		{
			get {return this._LoaiThoiGianIdList;}
			set 
			{
				this._LoaiThoiGianIdList = value;
				this.uxLoaiThoiGianIdDataGridViewColumn.DataSource = null;
				this.uxLoaiThoiGianIdDataGridViewColumn.DataSource = this._LoaiThoiGianIdList;
			}
		}
		
		private bool _allowNewItemInLoaiThoiGianIdList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of LoaiThoiGian
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInLoaiThoiGianIdList
		{
			get { return _allowNewItemInLoaiThoiGianIdList;}
			set
			{
				this._allowNewItemInLoaiThoiGianIdList = value;
				this.uxLoaiThoiGianIdDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
				
		private Entities.TList<Entities.NhomSanPham> _NhomSanPhamIdList;
		
		/// <summary> 
		/// The list of selectable NhomSanPham
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.NhomSanPham> NhomSanPhamIdList
		{
			get {return this._NhomSanPhamIdList;}
			set 
			{
				this._NhomSanPhamIdList = value;
				this.uxNhomSanPhamIdDataGridViewColumn.DataSource = null;
				this.uxNhomSanPhamIdDataGridViewColumn.DataSource = this._NhomSanPhamIdList;
			}
		}
		
		private bool _allowNewItemInNhomSanPhamIdList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of NhomSanPham
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInNhomSanPhamIdList
		{
			get { return _allowNewItemInNhomSanPhamIdList;}
			set
			{
				this._allowNewItemInNhomSanPhamIdList = value;
				this.uxNhomSanPhamIdDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
		#endregion
		
		#region Main Datasource
		
		private Entities.TList<Entities.ChietKhauDacBietDs> _ChietKhauDacBietDsList;
				
		/// <summary> 
		/// The list of ChietKhauDacBietDs to be displayed in the DGV.
		/// </summary>
		[System.ComponentModel.Category("Data")]
		public Entities.TList<Entities.ChietKhauDacBietDs> ChietKhauDacBietDsList
		{
			get {return this._ChietKhauDacBietDsList;}
			set
			{
				this._ChietKhauDacBietDsList = value;
				this.uxChietKhauDacBietDsBindingSource.DataSource = null;
				this.uxChietKhauDacBietDsBindingSource.DataSource = value;
				this.uxChietKhauDacBietDsDataGridView.DataSource = null;
				this.uxChietKhauDacBietDsDataGridView.DataSource = this.uxChietKhauDacBietDsBindingSource;				
				//this.uxChietKhauDacBietDsBindingSource.ListChanged += new System.ComponentModel.ListChangedEventHandler(uxChietKhauDacBietDsBindingSource_ListChanged);
				this.uxChietKhauDacBietDsBindingSource.CurrentItemChanged += new System.EventHandler(OnChietKhauDacBietDsBindingSourceCurrentItemChanged);
			}
		}
		
		private void OnChietKhauDacBietDsBindingSourceCurrentItemChanged(object sender, System.EventArgs e)
		{
			_currentChietKhauDacBietDs = uxChietKhauDacBietDsBindingSource.Current as Entities.ChietKhauDacBietDs;
			
			if (_currentChietKhauDacBietDs != null)
			{
				_currentChietKhauDacBietDs.Validate();
			}
			//_ChietKhauDacBietDs.Validate();
			OnCurrentEntityChanged();
		}

		//void uxChietKhauDacBietDsBindingSource_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e)
		//{
			//throw new Exception("The method or operation is not implemented.");
		//}		
		
		#endregion
		
		/// <summary>
		/// Gets the currently selected <see cref="Entities.ChietKhauDacBietDs"/> instance.
		/// </summary>
		public Entities.ChietKhauDacBietDs SelectedChietKhauDacBietDs
		{
			get {return this._currentChietKhauDacBietDs;}
		}
		
		#region other properties
		
		/// <summary>
		/// Gets or sets a value indicating whether you have provided your own data-management operations for the DataGridView control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool VirtualMode
		{
			get {return this.uxChietKhauDacBietDsDataGridView.VirtualMode;}
			set
			{
				this.uxChietKhauDacBietDsDataGridView.VirtualMode = value;
			}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the option to add rows is displayed to the user.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToAddRows
		{
			get {return this.uxChietKhauDacBietDsDataGridView.AllowUserToAddRows;}
			set {this.uxChietKhauDacBietDsDataGridView.AllowUserToAddRows = value;}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the user is allowed to delete rows from the DataGridView.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToDeleteRows
		{
			get {return this.uxChietKhauDacBietDsDataGridView.AllowUserToDeleteRows;}
			set {this.uxChietKhauDacBietDsDataGridView.AllowUserToDeleteRows = value;}
		}
		
		/// <summary>
		/// Gets the <see cref="DataGridView"/> instance.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public System.Windows.Forms.DataGridView DataGridView
		{
			get {return this.uxChietKhauDacBietDsDataGridView;}
		}
		
		/// <summary>
		/// Gets a collection that contains all the columns in the control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]		
		[System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Visible)]
		//[System.ComponentModel.EditorAttribute("System.Windows.Forms.Design.DataGridViewColumnCollectionEditor, System.Design", typeof(System.Drawing.Design.UITypeEditor))] 
		public System.Windows.Forms.DataGridViewColumnCollection Columns
		{
			get { return this.uxChietKhauDacBietDsDataGridView.Columns; }
		}
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;
	
		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	
		#region Constructor
	
		/// <summary>
		/// Initializes a new instance of the <see cref="ChietKhauDacBietDsDataGridViewBase"/> class.
		/// </summary>
		public ChietKhauDacBietDsDataGridViewBase()
		{			
			this.components = new System.ComponentModel.Container();			
			
			this.uxChietKhauDacBietDsDataGridView = new System.Windows.Forms.DataGridView();
			this.uxChietKhauDacBietDsBindingSource = new System.Windows.Forms.BindingSource(this.components);
			this.uxChietKhauDacBietDsErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxChietKhauDacBietDsidDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxNhomSanPhamIdDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxMucThuongDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxGhiChuDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxChietKhauIdDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxLastUpdateDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxUpdateByDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxLoaiThoiGianIdDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			//this.uxChietKhauIdBindingSource = new ChietKhauBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxChietKhauIdBindingSource)).BeginInit();
			//this.uxLoaiThoiGianIdBindingSource = new LoaiThoiGianBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxLoaiThoiGianIdBindingSource)).BeginInit();
			//this.uxNhomSanPhamIdBindingSource = new NhomSanPhamBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxNhomSanPhamIdBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxChietKhauDacBietDsDataGridView)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxChietKhauDacBietDsBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxChietKhauDacBietDsErrorProvider)).BeginInit();
			this.SuspendLayout();
						
			// 
			// uxChietKhauDacBietDsErrorProvider
			// 
			this.uxChietKhauDacBietDsErrorProvider.ContainerControl = this;
			this.uxChietKhauDacBietDsErrorProvider.DataSource = this.uxChietKhauDacBietDsBindingSource;						
			// 
			// uxChietKhauDacBietDsDataGridView
			// 
			this.uxChietKhauDacBietDsDataGridView.AutoGenerateColumns = false;
			this.uxChietKhauDacBietDsDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
			this.uxChietKhauDacBietDsDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
		this.uxChietKhauDacBietDsidDataGridViewColumn,
		this.uxNhomSanPhamIdDataGridViewColumn,
		this.uxMucThuongDataGridViewColumn,
		this.uxGhiChuDataGridViewColumn,
		this.uxChietKhauIdDataGridViewColumn,
		this.uxLastUpdateDataGridViewColumn,
		this.uxUpdateByDataGridViewColumn,
		this.uxLoaiThoiGianIdDataGridViewColumn			});
			this.uxChietKhauDacBietDsDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
			this.uxChietKhauDacBietDsDataGridView.Location = new System.Drawing.Point(0, 0);
			this.uxChietKhauDacBietDsDataGridView.Name = "uxChietKhauDacBietDsDataGridView";
			this.uxChietKhauDacBietDsDataGridView.Size = new System.Drawing.Size(470, 300);
			this.uxChietKhauDacBietDsDataGridView.TabIndex = 0;	
			this.uxChietKhauDacBietDsDataGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke;
			this.uxChietKhauDacBietDsDataGridView.EnableHeadersVisualStyles = false;
			this.uxChietKhauDacBietDsDataGridView.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.OnChietKhauDacBietDsDataGridViewDataError);
			this.uxChietKhauDacBietDsDataGridView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnChietKhauDacBietDsDataGridViewCellValueNeeded);
			this.uxChietKhauDacBietDsDataGridView.CellValuePushed += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnChietKhauDacBietDsDataGridViewCellValuePushed);
			
			//
			// uxChietKhauDacBietDsidDataGridViewColumn
			//
			this.uxChietKhauDacBietDsidDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxChietKhauDacBietDsidDataGridViewColumn.DataPropertyName = "ChietKhauDacBietDsid";
			this.uxChietKhauDacBietDsidDataGridViewColumn.HeaderText = "ChietKhauDacBietDsid";
			this.uxChietKhauDacBietDsidDataGridViewColumn.Name = "uxChietKhauDacBietDsidDataGridViewColumn";
			this.uxChietKhauDacBietDsidDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxChietKhauDacBietDsidDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxChietKhauDacBietDsidDataGridViewColumn.ReadOnly = true;		
			//
			// uxNhomSanPhamIdDataGridViewColumn
			//
			this.uxNhomSanPhamIdDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxNhomSanPhamIdDataGridViewColumn.DataPropertyName = "NhomSanPhamId";
			this.uxNhomSanPhamIdDataGridViewColumn.HeaderText = "NhomSanPhamId";
			this.uxNhomSanPhamIdDataGridViewColumn.Name = "uxNhomSanPhamIdDataGridViewColumn";
			this.uxNhomSanPhamIdDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxNhomSanPhamIdDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxNhomSanPhamIdDataGridViewColumn.ReadOnly = false;		
			//
			// uxMucThuongDataGridViewColumn
			//
			this.uxMucThuongDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxMucThuongDataGridViewColumn.DataPropertyName = "MucThuong";
			this.uxMucThuongDataGridViewColumn.HeaderText = "MucThuong";
			this.uxMucThuongDataGridViewColumn.Name = "uxMucThuongDataGridViewColumn";
			this.uxMucThuongDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxMucThuongDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxMucThuongDataGridViewColumn.ReadOnly = false;		
			//
			// uxGhiChuDataGridViewColumn
			//
			this.uxGhiChuDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxGhiChuDataGridViewColumn.DataPropertyName = "GhiChu";
			this.uxGhiChuDataGridViewColumn.HeaderText = "GhiChu";
			this.uxGhiChuDataGridViewColumn.Name = "uxGhiChuDataGridViewColumn";
			this.uxGhiChuDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxGhiChuDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxGhiChuDataGridViewColumn.ReadOnly = false;		
			//
			// uxChietKhauIdDataGridViewColumn
			//
			this.uxChietKhauIdDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxChietKhauIdDataGridViewColumn.DataPropertyName = "ChietKhauId";
			this.uxChietKhauIdDataGridViewColumn.HeaderText = "ChietKhauId";
			this.uxChietKhauIdDataGridViewColumn.Name = "uxChietKhauIdDataGridViewColumn";
			this.uxChietKhauIdDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxChietKhauIdDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxChietKhauIdDataGridViewColumn.ReadOnly = false;		
			//
			// uxLastUpdateDataGridViewColumn
			//
			this.uxLastUpdateDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxLastUpdateDataGridViewColumn.DataPropertyName = "LastUpdate";
			this.uxLastUpdateDataGridViewColumn.HeaderText = "LastUpdate";
			this.uxLastUpdateDataGridViewColumn.Name = "uxLastUpdateDataGridViewColumn";
			this.uxLastUpdateDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxLastUpdateDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxLastUpdateDataGridViewColumn.ReadOnly = false;		
			//
			// uxUpdateByDataGridViewColumn
			//
			this.uxUpdateByDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxUpdateByDataGridViewColumn.DataPropertyName = "UpdateBy";
			this.uxUpdateByDataGridViewColumn.HeaderText = "UpdateBy";
			this.uxUpdateByDataGridViewColumn.Name = "uxUpdateByDataGridViewColumn";
			this.uxUpdateByDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxUpdateByDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxUpdateByDataGridViewColumn.ReadOnly = false;		
			//
			// uxLoaiThoiGianIdDataGridViewColumn
			//
			this.uxLoaiThoiGianIdDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxLoaiThoiGianIdDataGridViewColumn.DataPropertyName = "LoaiThoiGianId";
			this.uxLoaiThoiGianIdDataGridViewColumn.HeaderText = "LoaiThoiGianId";
			this.uxLoaiThoiGianIdDataGridViewColumn.Name = "uxLoaiThoiGianIdDataGridViewColumn";
			this.uxLoaiThoiGianIdDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxLoaiThoiGianIdDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxLoaiThoiGianIdDataGridViewColumn.ReadOnly = false;		
			//
			// uxChietKhauIdDataGridViewColumn
			//				
			this.uxChietKhauIdDataGridViewColumn.DisplayMember = "StartDate";	
			this.uxChietKhauIdDataGridViewColumn.ValueMember = "ChietKhauId";	
			this.uxChietKhauIdDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxChietKhauIdDataGridViewColumn.DataSource = uxChietKhauIdBindingSource;				
				
			//
			// uxLoaiThoiGianIdDataGridViewColumn
			//				
			this.uxLoaiThoiGianIdDataGridViewColumn.DisplayMember = "TenLoaiThoiGian";	
			this.uxLoaiThoiGianIdDataGridViewColumn.ValueMember = "LoaiThoiGianId";	
			this.uxLoaiThoiGianIdDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxLoaiThoiGianIdDataGridViewColumn.DataSource = uxLoaiThoiGianIdBindingSource;				
				
			//
			// uxNhomSanPhamIdDataGridViewColumn
			//				
			this.uxNhomSanPhamIdDataGridViewColumn.DisplayMember = "SanPhamId";	
			this.uxNhomSanPhamIdDataGridViewColumn.ValueMember = "NhomSanPhamId";	
			this.uxNhomSanPhamIdDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxNhomSanPhamIdDataGridViewColumn.DataSource = uxNhomSanPhamIdBindingSource;				
				
			
			// this
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.Controls.Add(this.uxChietKhauDacBietDsDataGridView);
			this.Name = "ChietKhauDacBietDsDataGridView";
			this.Size = new System.Drawing.Size(470, 300);
			//((System.ComponentModel.ISupportInitialize)(this.uxChietKhauIdBindingSource)).EndInit();
			//((System.ComponentModel.ISupportInitialize)(this.uxLoaiThoiGianIdBindingSource)).EndInit();
			//((System.ComponentModel.ISupportInitialize)(this.uxNhomSanPhamIdBindingSource)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxChietKhauDacBietDsErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxChietKhauDacBietDsDataGridView)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxChietKhauDacBietDsBindingSource)).EndInit();
			this.ResumeLayout(false);
		}
		#endregion
				
		#region events
		
		/// <summary>
		/// Raised the CurrentEntityChanged event.
		/// </summary>
		protected void OnCurrentEntityChanged()
		{
			if (CurrentEntityChanged != null)
			{
				ChietKhauDacBietDsDataGridViewEventArgs args = new ChietKhauDacBietDsDataGridViewEventArgs();
				args.ChietKhauDacBietDs = _currentChietKhauDacBietDs;
				CurrentEntityChanged(this, args); 
			}
		}
		
		#endregion
		
		/// <summary>
		/// Strongly typed event 
		/// </summary>
		public class ChietKhauDacBietDsDataGridViewEventArgs : System.EventArgs
		{
			private Entities.ChietKhauDacBietDs	_ChietKhauDacBietDs;
	
			/// <summary>
			/// the  Entities.ChietKhauDacBietDs instance.
			/// </summary>
			public Entities.ChietKhauDacBietDs ChietKhauDacBietDs
			{
				get { return _ChietKhauDacBietDs; }
				set { _ChietKhauDacBietDs = value; }
			}	
		}
		
		/// <summary>
		/// Handles the DataError event of the uxChietKhauDacBietDsDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewDataErrorEventArgs"/> instance containing the event data.</param>
		protected void OnChietKhauDacBietDsDataGridViewDataError(object sender, System.Windows.Forms.DataGridViewDataErrorEventArgs e)
		{
			System.Diagnostics.Debug.WriteLine(string.Format( "{0}, {1}", e.ColumnIndex, e.RowIndex));
		}
		
		/// <summary>
		/// Handles the CellValueNeeded event of the uxChietKhauDacBietDsDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnChietKhauDacBietDsDataGridViewCellValueNeeded(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxChietKhauDacBietDsDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxChietKhauDacBietDsidDataGridViewColumn":
						e.Value = ChietKhauDacBietDsList[e.RowIndex].ChietKhauDacBietDsid;
						break;
					case "uxNhomSanPhamIdDataGridViewColumn":
						e.Value = ChietKhauDacBietDsList[e.RowIndex].NhomSanPhamId;
						break;
					case "uxMucThuongDataGridViewColumn":
						e.Value = ChietKhauDacBietDsList[e.RowIndex].MucThuong;
						break;
					case "uxGhiChuDataGridViewColumn":
						e.Value = ChietKhauDacBietDsList[e.RowIndex].GhiChu;
						break;
					case "uxChietKhauIdDataGridViewColumn":
						e.Value = ChietKhauDacBietDsList[e.RowIndex].ChietKhauId;
						break;
					case "uxLastUpdateDataGridViewColumn":
						e.Value = ChietKhauDacBietDsList[e.RowIndex].LastUpdate;
						break;
					case "uxUpdateByDataGridViewColumn":
						e.Value = ChietKhauDacBietDsList[e.RowIndex].UpdateBy;
						break;
					case "uxLoaiThoiGianIdDataGridViewColumn":
						e.Value = ChietKhauDacBietDsList[e.RowIndex].LoaiThoiGianId;
						break;
				default:
				break;
			}
		}
		
		/// <summary>
		/// Handles the CellValuePushed event of the uxChietKhauDacBietDsDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnChietKhauDacBietDsDataGridViewCellValuePushed(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxChietKhauDacBietDsDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxChietKhauDacBietDsidDataGridViewColumn":
						ChietKhauDacBietDsList[e.RowIndex].ChietKhauDacBietDsid = (System.Int32)e.Value;
						break;
					case "uxNhomSanPhamIdDataGridViewColumn":
						ChietKhauDacBietDsList[e.RowIndex].NhomSanPhamId = (System.Int32)e.Value;
						break;
					case "uxMucThuongDataGridViewColumn":
						ChietKhauDacBietDsList[e.RowIndex].MucThuong = (System.Byte)e.Value;
						break;
					case "uxGhiChuDataGridViewColumn":
						ChietKhauDacBietDsList[e.RowIndex].GhiChu = (System.String)e.Value;
						break;
					case "uxChietKhauIdDataGridViewColumn":
						ChietKhauDacBietDsList[e.RowIndex].ChietKhauId = (System.Int32)e.Value;
						break;
					case "uxLastUpdateDataGridViewColumn":
						ChietKhauDacBietDsList[e.RowIndex].LastUpdate = (System.DateTime)e.Value;
						break;
					case "uxUpdateByDataGridViewColumn":
						ChietKhauDacBietDsList[e.RowIndex].UpdateBy = (System.Int32)e.Value;
						break;
					case "uxLoaiThoiGianIdDataGridViewColumn":
						ChietKhauDacBietDsList[e.RowIndex].LoaiThoiGianId = (System.Byte)e.Value;
						break;
				default:
				break;
			}
		}
	}
}
